pkgname=avocado
pkgver=git
pkgrel=1
arch=('i386' 'x86_64')
url="https://github.com/avocado-framework"
license=('GPL')
makedepends_debian_11=(libffi-dev libssl-dev libvirt-dev libyaml-dev python3 python3-dev python3-disutils python3-libvirt python3-pip)
source=("https://gitee.com/ssri-mirrors/avocado.git")
md5sums=('SKIP')

build() {
	cd "$srcdir/$pkgname"

	# fixup openeuler
	[ -d "/usr/lib/python3" ] || {
		local dirs=(/usr/lib/python3.*)
		ln -s "${dirs[-1]}" /usr/lib/python3
	}
}

package() {
	cd "$srcdir/$pkgname"
	make DESTDIR=${pkgdir} install
	mkdir -p "${pkgdir}/lkp/benchmarks"
	mkdir -p "${pkgdir}/usr/lib"
	cp -af "/usr/lib/python3" "${pkgdir}/usr/lib"
	cp -af "$srcdir/avocado" "${pkgdir}/lkp/benchmarks"
}
